import {
  createQueryStatement,
  createQueryStatementCount,
  createdDeleteTextRealMark,
  createdDeleteTextMark,
  createVideoListByIds,
} from './statements';
import { getDB } from '../../db';

//查询
export const textMarkInfoQuery = async (queryParams: LX.DBService.TextMarkInfoQuery) => {
  return createQueryStatement(queryParams);
};

export const textMarkInfoQueryCount = async (queryParams: LX.DBService.TextMarkInfoQuery) => {
  return createQueryStatementCount(queryParams);
};

//删除
export const deleteTextMark = async (data: LX.DBService.textMarkUpdate) => {
  let statements = createdDeleteTextRealMark();
  if (data.type == 1) {
    statements = createdDeleteTextMark();
  }
  const db = getDB();
  db.transaction((data) => {
    statements.run(data);
  })(data);
};

//视频列表
export const getVideoListByIds = async (ids: String) => {
  const res = createVideoListByIds(ids);
  console.log(res);

  return res;
};
